<template>
  <div class="app-container" align="center" >


    <span  class="titleSylte" > {{blogId}}： {{titleContent}} </span>
    <!--只预览markdown-->
      <mavon-editor defaultOpen="preview"
                    :toolbarsFlag="false"
                    :subfield="false"
                    :preview="true"
                    class="makdownEditorStyle"
                    v-model="markdownContent"/>
  </div>
</template>

<script>
  import {getBlogContentById} from '@/api/apis'
  export default {


    data() {

      return {
        titleContent:'' ,
        markdownContent:" " ,
        blogId:" " ,
      }
    },
    created() {
      // let  blogId = this.$route.params.customerId;
      let  blogId = this.$route.query.blogId;
      this.fetchData(blogId)
    },
    methods: {
      fetchData(blogId ) {

        this.blogId = blogId  ;
        getBlogContentById( blogId).then(response => {
          this.titleContent = response.blogTitle ;
          this.markdownContent = response.blogContent;
        })
      }
    }
  }
</script>

<style scoped>

  .titleSylte {
    color: #4183c4;
    font-size: 20px;
  }

  .makdownEditorStyle {
    width: 80%;
    margin-top: 20px;
    min-height : 20px

  }

</style>

